package com.lishe.lishe.lishe.module.myorder.view;

import android.content.Context;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.view.Gravity;
import android.view.Window;

import com.lishe.lishe.R;

/**
 * 提醒卖家发货弹窗
 */
public class RemindSendDialog extends android.app.Dialog {

	private Context context;

	public RemindSendDialog(Context context) {
		super(context, R.style.transparent_dialog);
		this.context = context;
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.dialog_remindsend);
		Window dialogWindow = this.getWindow();
		dialogWindow.setGravity(Gravity.CENTER);

		/*Display display = dialogWindow.getWindowManager().getDefaultDisplay();
		WindowManager.LayoutParams lp = dialogWindow.getAttributes();
		lp.width = display.getWidth();
		dialogWindow.setAttributes(lp);*/

		//设置点击Dialog外部任意区域关闭Dialog
		setCanceledOnTouchOutside(true);
		new CountDownTimer(2000, 1000) {
			@Override
			public void onTick(long millisUntilFinished) {}

			@Override
			public void onFinish() {
				if (this != null && isShowing()) {
					dismiss();
				}
			}
		}.start();
	}

}
